package subumbo.demo.service
{
	import flash.events.Event;
	
	import subumbo.demo.model.CopyModel;
	import subumbo.demo.model.vo.WishFormCopyVO;

	public class CopyService extends AbstractService {
		
		[Inject] public var copyModel:CopyModel;
		
		public function set language(val:String):void {
			request.url = "resources/xml/" + val + ".xml";
		}
			
		protected override function onResult(e:Event):void {
			var xml:XML = XML(e.target.data);
			
			var wishForm:WishFormCopyVO = copyModel.whishForm;
			var wishFormXML:XMLList = xml.wish_form;
			wishForm.title = wishFormXML..title;
			wishForm.copy = wishFormXML..copy;
			wishForm.instruction = wishFormXML..instruction;
			wishForm.submitLabel = wishFormXML..preview_button;
		}
		
	}
}